﻿@using OpenReservation.Helpers
@using OpenReservation.Services
@using System.Net
@using System.Net.Sockets
@inject IApplicationSettingService applicationSettings
<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>@($"{ViewBag.Title} -- {applicationSettings.GetSettingValue("SystemTitle")}") </title>
    <environment names="Development">
        <link href="~/Content/bootstrap.css" rel="stylesheet" />
    </environment>
    <environment names="Staging,Production">
        <link href="https://cdn.bootcss.com/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    </environment>
    <style type="text/css">
        @@media only screen and (max-width:780px) {
            #githubLink {
                display: none;
            }
        }
    </style>
    @RenderSection("styles", required: false)
</head>
<body>
    <div class="navbar navbar-inverse navbar-fixed-top">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                @Html.ActionLink("系统管理后台", "Index", "Home", new { area = "Admin" }, new { @class = "navbar-brand" })
            </div>
            <div class="navbar-collapse collapse">
                <ul class="nav navbar-nav">
                    <li>@Html.ActionLink("预约", "Reservate", "ReservationManage")</li>
                    <li>@Html.ActionLink("预约管理", "Index", "ReservationManage")</li>
                    <li>@Html.ActionLink("网站首页", "Index", "Home", new { area = "" }, new { target = "_blank" })</li>
                    <li><a href="https://reservation-client.weihanli.xyz" title="新版网站首页">新版网站首页</a></li>
                </ul>
                <ul class="nav navbar-nav navbar-right">
                    <li class="dropdown">
                        <a href="javascript:void(0)" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
                            @(User.Identity.Name) <span class="caret"></span>
                        </a>
                        <ul class="dropdown-menu">
                            <li><a href="https://id.weihanli.xyz/Manage" target="_blank">我的账户</a></li>
                            <li><a href="https://id.weihanli.xyz/Manage/ChangePassword" target="_blank">修改密码</a></li>
                            <li>@Html.ActionLink("我的预约", "UserReservation", "Account", new { area = "" })</li>
                            <li role="separator" class="divider"></li>
                            <li>@Html.ActionLink("退出登录", "Logout", "Account", new { area = "" })</li>
                        </ul>
                    </li>
                </ul>
            </div>
        </div>
    </div>
    <div class="container body-content">
        <div class="main-content" style="margin-top: 5em">
            @RenderBody()
        </div>
        <hr />
        <footer>
            <p>&copy; @DateTime.UtcNow.Year - @applicationSettings.GetSettingValue("SystemTitle") &nbsp;&nbsp; HostIp: <strong>@(Dns.GetHostAddresses(Dns.GetHostName()).FirstOrDefault(_ => _.AddressFamily == AddressFamily.InterNetwork)) </strong></p>
        </footer>
    </div>
    <environment names="Development">
        <script src="~/Scripts/jquery-1.10.2.min.js"></script>
        <script src="~/Scripts/bootstrap.min.js"></script>
        <script src="~/Content/layer/layer.js"></script>
    </environment>
    <environment names="Staging,Production">
        <script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
        <script src="https://cdn.bootcss.com/twitter-bootstrap/3.4.0/js/bootstrap.min.js"></script>
        <script src="https://cdn.bootcss.com/layer/2.3/layer.js"></script>
    </environment>

    @RenderSection("scripts", required: false)
</body>
</html>